package leaguepicks;

/**
 * 
 * @author Qu huanwen
 * 
 */
public class LeaguePicks {
	public static void main(String[] args) {
		printArray(new LeaguePicks().returnPicks(3, 6, 98));

	}

	private static void printArray(int[] a) {
		for (int i = 0; i < a.length; i++)
			System.out.print(a[i] + " ");
		System.out.println();
	}

	public int[] returnPicks(int position, int friends, int picks) {
		int n1 = (position - 1) * 2 + 1;
		int n2 = (friends - position) * 2 + 1;
		int ns = n1 + n2;
		int p = picks - position + 1;
		int s = p % ns == 0 ? p / ns * 2 : p / ns * 2 + 1;

		int[] a = new int[s];
		int n = position;
		int i = 0;
		while (n <= picks) {
			a[i] = n;
			if (i % 2 == 1)
				n += n1;
			else
				n += n2;
			i++;
		}
		return a;
	}
}
